<div class="layer-wraper">
    <div class="main">
        <p class="title">审核不通过</p>
        <textarea placeholder="审核不通过原因~" id="reason" name="reason"></textarea>
        <div class="clearfix upload-img">

        </div>

        <div class="pop-btn">
            <a href="#" class="btn cancel">取消</a>
            <a href="#" class="btn green-btn " id="check_no_pass">确认</a>
        </div>
    </div>
</div>

<input type="hidden" name="review" id="review" value="{BEESCRM:$data[0]['review']}" />
<input type="hidden" name="checkId" id="checkId" value="{BEESCRM:$data[0]['check_id']}" />
<script>
    $(document).on('click', '.check_no_pass', function () {
        $("#reason").val('');
        $(".layer-wraper").show();
    });
    $(document).on('click', '.cancel', function () {
        $(".layer-wraper").hide();
    });

    $(document).on('click','#check_no_pass',function() { //初审不通过或者复审不通过
        var data={};
        data.basic_id = $("#basicId").val();
        data.type = 2;
        data.reason = $("#reason").val();
        if(!data.basic_id){
            fm.alert('参数错误,请稍后再试');return;
        }
        if(!data.reason){
            fm.alert('请说明审核不通过原因~');return;
        }
        if($("#review").val() == 1) {
            data.check_id = $("#checkId").val();
            data.type = 7; //复审不通过
        }

        $.ajax({
            url:"{BEESCRM::U('/meeting/meetingAppoint/appointSetting',array('account_id'=>$accountId))}",
            type:"post",
            data:data,
            dataType:"json",
            success:function(res){
                $(".layer-wraper").hide();
                fm.alert(res.message,'',2);
                setTimeout('location.href="/meeting/meetingAppoint/unaudited/audited/2/account_id/{BEESCRM:$accountId}"',3000);
            },
            error:function(res){
                fm.alert(res.message,'',3)
            }
        })
    })

</script>